package island.gotenyama.ui;

import island.gotenyama.beans.AppConstants;

import org.apache.pivot.beans.BXMLSerializer;
import org.apache.pivot.collections.Map;
import org.apache.pivot.wtk.Application;
import org.apache.pivot.wtk.Display;
import org.apache.pivot.wtk.Theme;
import org.apache.pivot.wtk.Window;

/**
 * 試算シミュレーションクラス
 * 
 * @author t.kawabata
 */
public class EstimationExplorer implements Application {

	/**
	 * 画面定義ファイルのパス
	 */
	private String BXML_PATH = "/island/gotenyama/ui/estimation_explorer_window.bxml";

	/**
	 * Windows
	 */
	protected Window window;

	@Override
	public void startup(Display display, Map<String, String> properties) throws Exception {

		// 初期設定
		Theme.getTheme().setFont(AppConstants.DEFAULT_FONT);

		// 画面読込
		BXMLSerializer bxml = new BXMLSerializer();
		window = (Window) bxml.readObject(EstimationExplorer.class, BXML_PATH);

		// 画面起動
		window.open(display);
	}

	@Override
	public boolean shutdown(boolean optional) throws Exception {
		if (window != null) {
			window.close();
		}
		return false;
	}

	@Override
	public void suspend() throws Exception {
	}

	@Override
	public void resume() throws Exception {
	}
}
